<link rel="stylesheet" href="__STATIC__mobile/css/buy.css">
<link rel="stylesheet" href="__STATIC__mobile/css/addressManage.css">
<script src="__STATIC__mobile/js/areadata.js"></script>
<script src="__STATIC__mobile/js/myarea.js"></script>

<div class="membersbox pad50">

	<form id="form1" action="/Order/add_order" method="post">
		<section class="msettlement_name">
			结算信息(<span>1</span>)
		</section>

		<!--  -->
		<div class="msettlement_goods_con">
			<section class="msettlement_url self_address pdl10"
				style="display: none;">
				<div>
					<p>
						<strong>联系人：</strong><strong><span class="J-selfname"></span></strong>
						<strong><span class="J-tel J-selfmobile"></span></strong>
					</p>
					<p class="adr J-selfaddress">
						<strong></strong>
					</p>
					<input type="hidden" class="J-selfaddressid" name="self_address_id"
						value="">
				</div>
			</section>


			<div class="j-alladdress mgb10 pdl10">
				<section class="msettlement_url e_address ">
					<section class="J-adDaddurl">
						<b class="new-urlA">请填写收货地址</b> <em class="new-urlB"></em> <input
							type="hidden" class="J-addressid e-addressid" name="address_id"
							value="">
					</section>

				</section>
				<section class="msettlement_url s_address " style="display: none;">
					<div class="addresscon">
						<p>
							<strong>收货人：</strong><strong><span class="J-name u_name"></span></strong>
							<strong><span class="J-tel u_tel"></span></strong>
						</p>
						<p class="adr J-address u_address">
							<strong>收货地址：</strong>
						</p>
						<a class="mod J-addressmodify" href="javascript:;">
						<img src="__STATIC__mobile/images/arr.png" width="10">
						</a>


						<input type="hidden" class="J-addressid u-addressid" name="address_id" value=""> 
						<input type="hidden" class="J-provinceid" name="province_id" value=""> 
						<input type="hidden" class="J-cityid" name="city_id" value="">
						<input type="hidden" class="J-areaid" name="area_id" value="">
					</div>
				</section>
			</div>

		</div>

		<div class="msettlement_goods_con"></div>

		<section class="msettlement_goods">
			<div class="msettlement_goods_con">
				<ul class="mgb10">
					<li class="g-box">
						<section>
							<a href="/Item/detail/id/4315"> <img
								src="http://img.wifenxiao.com/205/2015-01/54af21b9a6f37.jpg@!180x180"
								width="80" heigth="80">
							</a>
						</section>
						<section class="g-flex">
							<a href="/Item/detail/id/4315">梵贝蕾玫瑰精油蚕丝磁膜</a>
							<p></p>
							<p>
								<span>数量 ：×<i style="font-style: normal;" class="J-num">8</i>
								</span><b><i class="smallsize">¥</i><i style="font-style: normal;"
									class="J-pri">198.00</i></b>
							</p>
						</section> <input type="hidden" name="item_id[]" value="4315"> <input
						type="hidden" name="num[]" value="8"> <input type="hidden"
						name="sku_id[]" value=""> <input type="hidden"
						name="current_price[]" value="198.00"> <input
						type="hidden" name="current_dollar_price[]" value=""> <input
						type="hidden" value="0" class="consum_point">
					</li>
				</ul>
			</div>
			<div class="msettlement_goods_con">
				<section class="post_fee pdl10">
					<section class="msettlement_tit">
						<span>运费</span> <em class="settlement-choice fr"><i
							class="smallsize">￥</i>0</em> <input type="hidden" id="j-postFee"
							value="0">
					</section>
				</section>
				
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl"><span style="color:red;">*</span>详细地址:</section>
						<section class="content-textarea fl">
							<textarea class="text" name="message" placeholder="必填，详细地址"></textarea>
						</section>
					</section>
				</section>
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl">买家留言:</section>
						<section class="content-textarea fl">
							<textarea class="text" name="message" placeholder="选填，可填写您和卖家达成一致的要求"></textarea>
						</section>
					</section>
				</section>
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl">买家留言:</section>
						<section class="content-textarea fl">
							<textarea class="text" name="message" placeholder="选填，可填写您和卖家达成一致的要求"></textarea>
						</section>
					</section>
				</section>
				
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl">省份:</section>
						<section class="content-textarea fl">
							<select id="province" name="province" style="width:200px;"></select>
						</section>
					</section>
				</section>
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl">城市:</section>
						<section class="content-textarea fl">
							<select id="city" name="city" style="width:200px;"></select>
						</section>
					</section>
				</section>
				
				<section class="fixinline pdl10">
					<section class="textarea_content clearfix">
						<section class="content-name fl">区域:</section>
						<section class="content-textarea fl">
							<select id="county" name="county" style="width:200px;"></select>
						</section>
					</section>
				</section>
				
				
			</div>
			
			
			<!-- <section class="msettlement_goods_allrmb">商品总价 ：
                <span>&yen;1584</span>
            </section> -->
            
            
			<input type="hidden" name="total_price" id="j-totalPrice" value="1584">
		</section>

		<!--  -->
		<section class="msettlement_int">
			<section class="msettlement_intle">
				赠送积分 ： <span id="j-rateShow">1584</span>
			</section>
			<input type="hidden" id="j-rate" value="1">
			<section class="msettlement_intri">
				<!-- <p>
                    <span id="j-couponShow">优惠券抵 ： &yen;<i id="j-couponPrice"></i></span>

                    +&yen;<span class="J_post_fee">0</span>运费                    <input type="hidden" id="j-postFee" value="0">
                </p> -->
				<b><span id="j-totalPriceShow"><i class="smallsize">￥</i>1584.00</span><span
					class="j-dollar"></span></b> <input type="hidden" name="payment"
					value="1584.00"> <input type="hidden" name="dollar_payment"
					value="0">
			</section>
			<input type="hidden" id="postage" name="post_price" value="0">
			<input type="hidden" name="cart_ids" value="20289">
		</section>
		<!--余额支付-->
		<input type="hidden" name="balance_price" value="0.00">

		<section class="msettlement_tpay  J_pay_type" style="background: #eee">
			<div class="rechargeitem newitem">
				<a href="javascript:;" class="btn-addorder is_alipay org"
					data-type="payment" title="支付宝支付" data-value="1"> <img
					src="__STATIC__mobile/images/alipay.png"> <span>支付宝</span> <input
					type="radio" name="type" value="1" id="zfb">
				</a>
			</div>
			<div class="paymethodnote"></div>
		</section>
		<input type="hidden" value="0.00"> <input type="hidden"
			value="0" name="is_freight"> <input type="hidden" value="0"
			name="is_user_temp"> <input type="hidden" name="code"
			value="722143"> <input type="hidden" name="item_total_num"
			value="0"> <input type="hidden" name="item_total_weight"
			value="0"> <input type="hidden" name="item_total_volume"
			value="0"> <input type="hidden" name="freight_tpl_id"
			value="">

		<section class="msettlement_but"
			style="margin-top: 0px; display: none;">
			<input type="hidden" value="" name="item_miao_id"> <input
				type="hidden" value="" name="item_limit_discount_id"> <input
				type="hidden" value="" name="item_bargin_id">
			<!--<button type="submit" class="butorange">提交订单</button>-->
			<a href="javascript:;" class="butorange btn-addorder js-butorange">提交订单</a>
		</section>
		<section class="msettlement_bottom">
			<!-- <p>支付后如需退货，请及时联系卖家</p>
            <p>由 微分销平台 提供技术支持</p> -->
		</section>
	</form>

	<input type="hidden" value="2" id="default_pay"> <input
		type="hidden" value="" id="full_mail_show"> <input
		type="hidden" value="" id="popup_sow">
	<!-- 输入支付密码弹窗 -->
	<div class="paypopbg"></div>
	<div class="paypop">
		<div class="paytit">请输入支付密码：</div>
		<div class="paypsd">
			<input type="password" name="pay_password" value="">
		</div>
		<div class="paybtns clearfix">
			<a href="javascript:;" class="j-payok fl">确定</a> <a
				href="javascript:;" class="j-paycancel fr">取消</a>
		</div>
	</div>
	<div class="paypopnote">
		<span>正在提交中……</span>
	</div>

	<!-- 弹窗 -->
	<div class="fixpopbg" style="display: none;" id="j-fixpopbg"></div>
	<div class="fixpop" id="settlement" style="display: none;">
		<section class="freepay-select" style="display: block;"
			data-type="send">
			<a href="javascript:;" class="btn-close"></a>
			<h2>配送方式</h2>
			<form action="">
				<ul class="select-list">
					<li><i class="postname">快递</i> ¥<i class="postfree">0</i></li>
				</ul>
			</form>
			<section class="actions bdbox clearfix">
				<a href="javascript:;" class="fl btn-cancel bdbox j-post-sure">确定</a>
			</section>
		</section>
		<section class="coupon-select" data-type="coupon"
			style="display: none;">
			<a href="javascript:;" class="btn-close"></a>
			<h2>店铺优惠</h2>
			<form action="">
				<ul class="select-list J-intlist">
					<li data-num="0"><label class="clearfix"> <input
							type="hidden" class="j-no-coupon" value=""> <span
							class="fl">不用优惠</span> <label class="J-inp fr"> <input
								type="checkbox" name="checkbox[]" value=""> <em></em>
						</label>
					</label></li>
				</ul>
			</form>
			<section class="actions bdbox clearfix">
				<a href="javascript:;" class="fl btn-cancel bdbox j-sure">确定</a>
			</section>
		</section>
		<section class="payment-details" data-type="payment"
			style="display: none;">
			<a href="javascript:;" class="btn-close j-close-fixpop"></a>
			<h2>付款详情</h2>
			<form action="">
				<section>
					<span class="pay-way fl">支付方式</span> <span
						class="pay-way-content fr">支付宝支付</span>
				</section>
				<section>
					<span class="need-pay fl">需付款</span> <span
						class="price fr js-total-pay">7.00元</span>
				</section>
				<section class="pay-btn">
					<a href="javascript:;" class="js-btn-addorder js-sure-btn"
						data-type="payment" title="支付宝支付" data-value="1">确认支付</a>
				</section>
			</form>
		</section>

	</div>

	<include file="Common:bottom" />
	<b id="htmlReplace-navCart"></b>

</div>
<include file="Common:nav" />
<include file="Common:xuanfubtn" />
<include file="Common:collectbtn" />
<include file="Common:js" />






<script src="__STATIC__mobile/js/underscore-min.js"></script>
<script src="__STATIC__mobile/js/jquery.cookie.min.js"></script>
<script src="__STATIC__mobile/js/addressManage.js"></script>
<script src="__STATIC__mobile/js/address.js"></script>
<script src="__STATIC__mobile/js/addressmgt.js"></script>
<script src="__STATIC__mobile/js/buy.js"></script>
<script type="text/javascript">
	$(function() {
		// 判断是否在付款中
		var paying = $.cookie("paying");
		if (paying)
			window.location.href = '/Order/lists';
		$(".msettlement_balance label").click(function() {
			if ($(this).children('input').is(':checked')) {
				$(this).children('em').addClass('cur');
				comparePrice();
			} else {
				$(this).children('em').removeClass('cur');
				$('.J_pay_type').show();
				$('.msettlement_but').hide();
			}
		});
		$(".msettlement_balance label em").click(function() {
			$(".msettlement_balance label").click();
		});

		var i = $("#default_pay").val();

		$('.msettlement_tpay .cod' + i).find('b').show();
		$('.msettlement_tpay label').click(function() {
			$('.msettlement_tpay label').find('b').hide();
			$('.msettlement_tpay label').find('i').hide();
			$(this).find('b').show();
			$(this).find('i').show();
		});
		if ($(".msettlement_balance label input").is(':checked')) {
			/*$(".msettlement_balance label input").css("visibility","hidden");*/
			$(".msettlement_balance label em").addClass('cur');
			// $(".butorange").show();
			// $('.J_pay_type').hide();
			comparePrice();
		} else {
			$('.msettlement_but').hide();
		}
		if ($(".msettlement_tpay label input").is(':checked')) {
			$(".msettlement_tpay label input").css("visibility", "hidden");

		}

		function comparePrice() {
			var str = $('#j-totalPriceShow').html();
			str = str.replace('<i class="smallsize">￥</i>', '');
			var totalPrice = parseFloat(str);
			var sum = parseFloat($('#sumPrice').html());
			var sumPrice = $(':hidden[name="balance_price"]').val();
			if (sum < totalPrice) {
				$.Error('余额不足，可选择一种支付方式进行支付');
				$('.J_pay_type').show();
				$('.msettlement_but').hide();
			} else {
				$('.J_pay_type').hide();
				$('.msettlement_but').show();
			}
			/* if(parseInt(sumPrice) == 0){
			     $('.msettlement_but').hide();
			 }*/
		}
		;

		// 选择
		// $(".msettlement_balance label input").click(function() {
		// if($(".msettlement_balance label input").is(':checked')){
		//     $(this).attr('checked',true).css("visibility","hidden");
		//     $(this).next("b").css("visibility","visible");
		// }else{
		//     $(this).attr('checked',false).css("visibility","visible");
		//     $(this).next("b").css("visibility","hidden");
		// }
		// });
		$(".msettlement_tpay label input").click(
				function() {
					//alert($(".msettlement_tpay label input").is(':checked'))
					if ($(".msettlement_tpay label input").is(':checked')) {
						$(this).attr('checked', true).css("visibility",
								"hidden");
						$(this).parent("label").addClass('checked').siblings(
								'label').removeClass('checked');
						$(this).next("b").css("visibility", "visible");
					} else {
						$(this).attr('checked', false).css("visibility",
								"visible");
						$(this).parent("label").removeClass('checked')
								.siblings('label').removeClass('checked');
						$(this).next("b").css("visibility", "hidden");
					}
				});

		//提交
		$("#form1")
				.submit(
						function() {
							$('.paypopnote').show();
							var type = $("input[name='type']:checked").val(), passed = true, money_type = $(
									'input[name="money_type"]:checked').val();
							if (isNaN(type) && isNaN(money_type)) {
								$.Error("请选择支付方式");
								passed = false;
							}
							return passed;
						});
		$('.e_address').show();
		$('.s_address').hide();
	})

	function fcxr() {
		$('#topAlert').show();
		var divObj = document.createElement("section");
		divObj.setAttribute('id', 'topAlert');
		divObj.innerHTML = ' ';
		var first = document.body.firstChild;//得到页面的第一个元素
		document.body.insertBefore(divObj, first);//在得到的第一个元素之前插入
		setTimeout(function() {
			$('#topAlert').hide();
		}, 2000);
	}
</script>
<script type="text/javascript">
city.getcity('province','city','county','{self province}','{self city}','{self county}',1);                     
</script>

